﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Sistema.WF.Componentes.Controles
{
     public class R2TextBox : TextBox
    {
         R2Configuracoes _conf = new R2Configuracoes();

         public R2TextBox()
         {
             Configura(_conf);
           
         }
         public R2TextBox(R2Configuracoes conf)
         {
             _conf = conf;
             Configura(this._conf);
         }

         private void Configura(R2Configuracoes _conf)
         {
             Width = 160;
             Height = 20;
             TextAlign = HorizontalAlignment.Left;
             BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             BackColor = System.Drawing.Color.White;
             Font = _conf.Fonte;
         }

         protected override void OnGotFocus(EventArgs e)
         {
             base.OnGotFocus(e);
             this.BackColor = _conf.OnFocus();

         }
         protected override void OnLostFocus(EventArgs e)
         {
             base.OnLostFocus(e);
             this.BackColor = _conf.LostFocus();

         }
    }
}
